<?php



namespace app\api\controller;

use app\common\controller\Api;
use think\Db;

/**
 * h会议安排
 */
class Zixun extends Api
{

    protected $noNeedLogin = [''];
    // 无需鉴权的接口,*表示全部
    protected $noNeedRight = ['*'];


    /*
     *  fa_information
     * */
    public function getallzixun()
    {

        $zixun = Db::name('information')->order('weigh desc')->select();

        foreach ($zixun as $key => $value){

            $zixun[$key]['image']=cdnurl($value['image'],true);

            $zixun[$key]['addtime']=date('Y-m-d H:i',$value['addtime']);
        }


        $this->success('咨讯',$zixun);

    }

    public function getinfobyid(){

        $id = $this->request->param('id');

        $zixun = Db::name('information')->where('id',$id)->find();

        $zixun['image']=cdnurl($zixun['image'],true);
        $zixun['addtime']=date('Y-m-d H:i',$zixun['addtime']);

        $this->success('咨讯',$zixun);


    }

    public function getzixunbytype(){

        $lists=Db::name('qa')->order('weigh desc')->select();

        $this->success('咨讯',$lists);
    }

}